<?php

namespace App\Model;

use App\Helpers\AliyunUtil;
use Illuminate\Database\Eloquent\Model;

/**
 *  礼物
 */
class Gift extends Model
{
    protected $table = 'gift';

    const TYPE = [
        1 => '普通礼物',
        2 => '系统礼物',
        3 => '背包礼物',
        4 => '金币礼物',
    ];

    static function getList($type = 0)
    {
        $where = [
            'flag' => 1
        ];
        if ($type && is_array($type)) {
            return self::where($where)->whereIn('type', $type)->pluck('name', 'id')->toArray();
        } elseif ($type) $where['type'] = $type;
        return self::where($where)->pluck('name', 'id')->toArray();
    }
}
